// index.js
// 获取应用实例
const app = getApp()
Page({
  data: {
    pics:[{
      id:1,
      url:'../../images/index/index1.png'
    },{
      id:2,
      url:'../../images/index/index2.png'
    },{
      id:3,
      url:'../../images/index/index3.png'
    }],
    list_title:['推荐','全部','VIP','双人','休闲'],
    list_item: [{
        title: '好好学习，天天向上',
        src: '../../images/index/index1.png'
    }, {
        title: '己所不欲，勿施于人',
        src: '../../images/index/index1.png'
    }, {
        title: '道不同不相为谋',
        src: '../../images/index/index2.png' 
    }, {
        title: '天将降大任于私人也',
        src: '../../images/index/index3.png'
    },
    {
        title: '今天是个好日子',
        src: '../../images/index/index3.png'
    }],
    curIndex: 0,
    scrollLefts: 0
  },
  // 导航栏滑动
  tabNav(e) {
    // 分类查询
    console.log(e.target.dataset.index);
    let index = e.target.dataset.index;
    this.setData({
      curIndex: index,
      scrollLefts: (index - 2) * 65
    })
  },
  toDetail(options) {
    wx.navigateTo({
      url: '../activity/activity?id='+options.target.dataset.id,
    })
  },
  goNotice(){
    wx.navigateTo({
      url: '../notice/notice',
    })
  }
})